﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
    [TestClass]
    public class ReportType_Proprietary_Test
    {
        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test01_Equals()
        {
            ReportType_Proprietary reportTypeProprietary = new ReportType_Proprietary(false, 0x03);

            {
                // completely different type - NOT equal
                object dummyObject = new object();
                Assert.IsFalse(reportTypeProprietary.Equals(dummyObject));
            }

            {
                // same type - same property values
                ReportType_Proprietary reportTypeProprietary2compare = new ReportType_Proprietary(reportTypeProprietary.OnOffFlag, reportTypeProprietary.ProprietaryNibble);
                Assert.IsTrue(reportTypeProprietary.Equals(reportTypeProprietary2compare));
            }

            {
                // same type - different OnOffFlag
                ReportType_Proprietary reportTypeProprietary2compare = new ReportType_Proprietary(!reportTypeProprietary.OnOffFlag, reportTypeProprietary.ProprietaryNibble);
                Assert.IsFalse(reportTypeProprietary.Equals(reportTypeProprietary2compare));
            }

            {
                // same type - different ProprietaryByte
                ReportType_Proprietary reportTypeProprietary2compare = new ReportType_Proprietary(reportTypeProprietary.OnOffFlag,
                    (byte)(reportTypeProprietary.ProprietaryNibble + 1));
                Assert.IsFalse(reportTypeProprietary.Equals(reportTypeProprietary2compare));
            }
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test02_GetHashCode()
        {
            ReportType_Proprietary reportTypeProprietary = new ReportType_Proprietary(false, 0x08);
            int hashCode01 = reportTypeProprietary.GetHashCode();
        }

        [TestMethod]
        [Owner("Frank Eppink")]
        public void Test03_ToString()
        {
            ReportType_Proprietary reportTypeProprietary = new ReportType_Proprietary(true, 0x0a);
            string stringResult = reportTypeProprietary.ToString();
            Assert.IsNotNull(stringResult);
        }
    }
}
